package scheduledtasks.parscorn;



import scheduledtasks.entity.TaskObj;

import java.util.Date;


/**
 * 【周解析]
 *
 * @author tiny
 * @version 1.0
 * @company bc
 * @copyright (c) 2022 bcInc. All rights reserved.
 * @date 2022-11-08 16:00:26
 * @since
 */

public class WeekParse extends ParseAbstract {

    @Override
    public boolean pars(String cron, TaskObj obj) {
        String cronstr=ParsUntil.getcron(cron,5);
        if(Wenk(cronstr) || cronstr.equals("*")){
          return   getParseAbstract().pars(cron,obj);

        }
        return false;
    }


    public boolean Wenk(String cr){
        Date date=new Date();
        String week= ParsUntil.getWeekOfDate(date);
        if(cr.equals(week)){
            return true;

        }
        return false;
    }




}
